package com.linkhub.oms.admin.modules.wms.controller;

import com.linkhub.oms.admin.modules.wms.domain.param.*;
import com.linkhub.oms.admin.modules.wms.domain.vo.WMSConfirmResponse;
import com.linkhub.oms.admin.modules.wms.service.WmsConfirmService;
import com.linkhub.oms.data.sync.api.wms.domain.request.WmsBaseURLRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Description: WMS确认接口
 * @Author: Jaycle
 * @Date: 2024/6/15 21:43
 * @Version: 1.0
 */
@Slf4j
@RestController
@Api(tags = {"WMS确认接口"})
@RequestMapping("/wms")
public class WmsConfirmController {

    @Resource
    private WmsConfirmService wmsConfirmService;

    @PostMapping("/warehouse_arrant_confirm")
    @ApiOperation(value = "入库单确认接口")
    public WMSConfirmResponse warehouseArrantConfirm( @RequestBody WarehouseArrantConfirmParam warehouseArrantConfirmParam ) {
        wmsConfirmService.warehouseArrantConfirm(warehouseArrantConfirmParam);
        return new WMSConfirmResponse();
    }

    @PostMapping("/delivery_list_confirm")
    @ApiOperation(value = "出库单确认接口")
    public WMSConfirmResponse deliveryListConfirm( @RequestBody DeliveryListConfirmParam deliveryListConfirmParam ) {
        wmsConfirmService.deliveryListConfirm(deliveryListConfirmParam);
        return new WMSConfirmResponse();
    }

    @PostMapping("/stock_count_notice")
    @ApiOperation(value = "库存盘点通知接口")
    public WMSConfirmResponse stockCountNotice( @RequestBody StockCountNoticeParam stockCountNoticeParam ) {
        wmsConfirmService.stockCountNotice(stockCountNoticeParam);
        return new WMSConfirmResponse();
    }

    @PostMapping("/transfer_order_notice")
    @ApiOperation(value = "转移单确认接口")
    public WMSConfirmResponse transferOrderNotice( @RequestBody TransferOrderNoticeParam transferOrderNoticeParam ) {
        wmsConfirmService.transferOrderNotice(transferOrderNoticeParam);
        return new WMSConfirmResponse();
    }

    @PostMapping("/process_order_notice")
    @ApiOperation(value = "加工单确认接口")
    public WMSConfirmResponse processOrderNotice( @RequestBody ProcessOrderNoticeParam processOrderNoticeParam ) {
        wmsConfirmService.processOrderNotice(processOrderNoticeParam);
        return new WMSConfirmResponse();
    }

    @PostMapping("/confirms")
    @ApiOperation(value = "WMS确认接口")
    public WMSConfirmResponse Confirms( @ModelAttribute WmsBaseURLRequest requestParam,
                                        @RequestParam("sign") String sign,
                                        @RequestBody String data ) {
        return wmsConfirmService.wmsConfirms(requestParam, sign, data);
    }

}
